New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sub fixes #4176
Sub fixes #4176
Conversation
@elupus: Note that the auto-enabling not working, is a regression from previous behaviour as this used to work fine until the previous round of subtitle-changes went in. |
Well. I doubt it's possible to solve without breaking something else. We are miss-using video settings for current status. Either we:
With current impl. those are our choices. :( |
Taken from #4116
Thanks for the friendly reply. You didn't reply for a week, but if I don't reply within some hours you open a pr that replaces mine? Taken from your pr description:
My pr did.
My pr avoided that, yours does not! This can be seen here: if(!valid)
{
CloseSubtitleStream(true);
visible = false;
}
SetSubtitleVisibleInternal(visible); If a user has enables subs by default and the video has no subtitle stream, you will store false in the db. That is the reason why I only called it after a successful open(). And wrote that several times. This also fixes @arnova's issue. |
I really did not intend to offend you by opening a new pull request. Sorry! I just ended up working on it since you had ignored my comments on always Like I said above. It's a tradeof between two issues. Either gui represent You solution caused gui to show enabled with no subs at all, to solve the Again I'm really sorry if I offended you. |
Also note. that what you proposed would be inconsistent. Take the situation of one internal forced sub, prefer external subs on: On first play this will get enabled and set visible. It will be stored in video settings. If external subs was there on first play they would have been selected. |
Auto enabling external subtitles have been working in xbmc since I can remember (definitely back to xbox days). The only difference now is that users have an option to prefer them or not. Previously, before ace2002 redid subtitle preference logic, external subtitles were preferred and enabled automatically. Not auto enabling them is definitely new and hopefully unexpected behaviour (when prefer external subtitles: on). If user sets Prefer external subtitles to on then external subtitles should be always preferred (displayed) no matter when they were actually added. |
External subs will auto enable with this... It's only if you play the video Note above used to work too. But can't be fixed without reverting bunch if |
Of course I did, even several times. Last time (taken from #4116 (comment)) : The call of SetSubtitleVisibleInternal() is at the end/latest possible place. Because if we don't have valid subs, e.g., the file has no subs at all, we decided to not alter the stored db value of subs on/off. And that based on YOUR comment #4116 (comment) :
I replied:
Follwed by your comment #4116 (comment) :
And here you wrote the contrary:
You did not intend to offend me. Okay, I want to believe that, although it is quite hard give the facts I presented above. |
That must be a long time ago the following is from the file dated back to 06.05.2012: xbmc/xbmc/cores/dvdplayer/DVDPlayer.cpp Line 151 in 240692b
static bool PredicateSubtitlePriority(const SelectionStream& lh, const SelectionStream& rh)
{
if(!g_settings.m_currentVideoSettings.m_SubtitleOn)
{
PREDICATE_RETURN(lh.flags & CDemuxStream::FLAG_FORCED
, rh.flags & CDemuxStream::FLAG_FORCED);
}
PREDICATE_RETURN(lh.type_index == g_settings.m_currentVideoSettings.m_SubtitleStream
, rh.type_index == g_settings.m_currentVideoSettings.m_SubtitleStream); As you can see, if subs are on it takes the stream that was saved, and not a newly added ext. subtitle. |
I meant very long ago yes. Before the predicate stuff was added. Yes I indeed changed my mind on what is better gui or that feature. |
@ace20022: There were some timeframes when it wasn't actually working. I believe these are pretty common user scenarios: |
Okey.. If having invalid GUI display is better in the no subtitles at all case, i can accept that. But it will still be invalid in the case of the video having internal subtitles and you open it once, then add external. That is just not solvable at the moment sadly. |
@elupus: Ok so if I understand correctly we at least agree that for movies that didn't have any subtitles before (-1 for the subtitle stream in the db), external subs added later on should always auto-enable (if subtitles are enabled in the default video settings) ? |
I've restored the workaround for that special case. I've dropped the dvdplayer "fix" since it seems that will just make things worse. @Voyager1 if you could test the case that was the source of: eee58b9 that would be very good. jenkins build this please |
Since I managed to get some junk in that last push and had lost correct author on one commit. Dear jenkins build this please |
I only use external subs rarely, but I wouldn't want an external subtitle to be auto-enabled when I watch a movie. They only should be shown when a user manually turns on subtitles for the playing video like it's the case for embedded ones (unless they are forced ofc). The setting "prefer external/downloaded over embedded subs" should only prefer the external subs over the embedded one if both are available for a certain language. It's no "always enforce external subs" setting. |
If you don't want external subtitles to be automatically displayed it's reasonable to have Prefer external subtitles off and manually turn them on while playing a video when you need them to be displayed. Your suggestion would actually not help your case, but would make others who use external subtitles exclusively pretty much difficult to select them manually all the time (over embedded subtitles with forced or default flags). @elupus: Sorry in advance for maybe a "dumb" question. Do I understand correctly that the only problem with auto enabling external subtitles with your case (video having internal subtitles and you open it once, then add external) is because on first video playback xbmc saves Audio, Subtitles and Video settings to settings table in database for that file and you don't want to alter that once it saved without user interaction? If it is so why these settings are automatically saved when user didn't actually make any active change himself? |
@ezechiel1917 The setting is called "prefer external subtitels". So in case I download a external sub for a language I also have an embedded sub for, the external should be preferred in the predication. That's at least how I understand this setting. |
Well it is kinda strange that we store SubtitleOn = 0 (false) in the db for a subtitle which isn't there (-1 in the db), this isn't how it always been. IMO it should reflect the default video settings which says it's enabled by default, even when there's no sub (-1) (yet). |
@da-anda: That makes sense. Suggested spinner could also potentially help with elupus case if user deliberately choose Forced for External subtitles priority (Then external subtitles could be always displayed even over any previously saved SubtitleStream in settings table). |
The reason here was simple: we enter several times in OpenDefaultStreams - once initially, once after IsBetterStream... Problem is that during first pass, valid became false because the subtitle streams are not known yet - and thus the logic would turn off the subtitles visibility too early, even if the DVD navigator would at the second pass have subtitle streams (problem is that at the second pass there's nothing to turn them back on before finding valid subtitle streams) |
@Voyager1 ok. That issue is sort of handled too by the special case commit i added. So we should be okey there. @ezechiel1917 It's not a question of want. We can't alter it. The current code respect the selected video stream from previous run. So if we store video settings at all, we will always return to previous settings. |
I tested it and indeed it works. I also looked at the commit and you mention it's a temporary fix. Let's just keep in mind to be careful when re-enabling it with a better fix, because the DVD use case will always be a little bit different. |
@popcornmix can you check rbpi build with this, since jenkins isn't too happy about the ffmpeg changed. |
You've missed this from omxplayer patch:
should be
|
@elupus I see, but why is it needed to store video setting if user didn't change anything while playing a video? Wouldn't global default settings be sufficient in such case or is the goal here that once you play a video, to play it with exactly the same settings on next playback (including the case where user only pressed start/stop)? |
IMO we should differ between resume state (which would hold the last used setting) and the default setting for a video. This would also fix this bug. So we'd need to store the audio and subtitle track on a per resume point basis for ongoing playbacks and start from defaults/stored settings on new playback. |
for the record, this elupus@c6d477d is not my patch. |
@ace20022 hmm.. okey who's is it? it had your name in your branch |
@popcornmix there. let's hope that was it. btw, i have factored all this out into separate files to avoid the duplication for Gotham+1. -400 lines of code duplication :) |
@elupus That builds okay. |
No idea, but in the commit from my branch that looks quite similar, |
Ah, I indeed squashed another commit into yours that moved it to protected. |
that's even better |
This avoids overriding result of OpenDefaultStreams forced/relevant calculation due to SetSubtitleVisible being delayed by message queue. Original-patch-by: ace20022 <ace20022@xbmc.org>
Original patch by: ace20022
… found Note: This should be reverted when we have separated GUI display from user specified settings. It temporarily solves the use case of user starting a movie without subs, stop it, add external subtitles, start it again.
@elupus: Please wait for an RM to merge at this point unless the RM has specifically said it's OK in the PR. Thanks for flying Gotham airways. :) |
@elupus slaps himself with a large trout. Sorry i'm usually pretty good at that :( On Sun, Feb 9, 2014 at 9:30 PM, jmarshallnz notifications@github.comwrote:
|
This PR fixes
http://trac.xbmc.org/ticket/14821
http://trac.xbmc.org/ticket/14864
This replaces: #4116